package com.ruoyi.hotel.domain.converter;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

public class PageConverter {

    public static <T> IPage<T> convertToPage(IPage<?> iPage, List<T> list){
        IPage<T> result = new Page();
        result.setRecords(list);
        result.setPages(iPage.getPages());
        result.setCurrent(iPage.getCurrent());
        return result;
    }
}
